<?php
include '../../include/dbFunctions.php';

$valid = "true";

$email = trim(strtolower($_REQUEST['contact_email']));

$query = executeSelectQuery("SELECT contact_email FROM contact_school WHERE contact_email = '" . $email . "';");

if (count($query) > 0) {
    $valid = "false"; //Email is existed, cannot use
}
echo $valid;




/* For Debugging
  $query = "SELECT * FROM username WHERE email = '" . $email . "';";
  foreach ($dbh->query($query) as $row) {
  echo $row['email'] . "<br/>";
  }
 */
?>
